<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>顾客信息修改</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet"
          th:href="@{/resource/layui/css/layui.css}"
          media="all">
    <script type="text/javascript"
            th:src="@{/resource/js/jquery-3.6.0.min.js}"></script>

</head>
<body>

<fieldset class="layui-elem-field layui-field-title"
          style="margin-top: 20px;">
    <legend>顾 客 信 息 修 改</legend>
</fieldset>

<form class="layui-form" action="">

    <div class="layui-form-item">
        <label class="layui-form-label">客户编号</label>
        <div class="layui-input-inline">
            <input type="text" name="customerId" lay-verify="customerId"
                   autocomplete="off" disabled class="layui-input  layui-disabled"
                   value="${ updateCustomer.customerId }">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">客户名称</label>
        <div class="layui-input-inline">
            <input type="text" name="customerName" lay-verify="customerName"
                   autocomplete="off" class="layui-input" value="${ updateCustomer.customerName }">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">客户全称</label>
        <div class="layui-input-inline">
            <input type="text" name="customerFullName" lay-verify="customerFullName"
                   autocomplete="off" class="layui-input" value="${ updateCustomer.customerFullName }">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">地址</label>
        <div class="layui-input-inline">
            <input type="text" name="address" lay-verify="address"
                   autocomplete="off" class="layui-input" value="${ updateCustomer.address }">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">传真</label>
        <div class="layui-input-inline">
            <input type="text" name="fax"
                   lay-verify="fax" autocomplete="off"
                   class="layui-input" value="${ updateCustomer.fax }">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">邮箱</label>
        <div class="layui-input-inline">
            <input type="text" name="email"
                   lay-verify="email" autocomplete="off"
                   class="layui-input" value="${ updateCustomer.email }">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">经理姓名</label>
        <div class="layui-input-inline">
            <input type="text" name="managerName"
                   lay-verify="managerName" autocomplete="off"
                   class="layui-input" value="${ updateCustomer.managerName }">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">联系电话</label>
        <div class="layui-input-inline">
            <input type="text" name="telephone"
                   lay-verify="telephone" autocomplete="off"
                   class="layui-input" value="${ updateCustomer.telephone }">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">客户状态</label>
        <div class="layui-input-block">
            <input type="radio" name="status" value="有效客户" title="有效客户" checked="">
            <input type="radio" name="status" value="无效客户" title="无效客户">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-inline">
            <input type="text" name="demo"
                   lay-verify="demo" autocomplete="off"
                   class="layui-input" value="${ updateCustomer.demo }">
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="submit" class="layui-btn" lay-submit=""
                    lay-filter="submitButton">立即提交
            </button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>

<script th:src="@{/resource/layui/layui.js}"
        charset="utf-8"></script>

<script>
    layui
        .use(
            ['form', 'layedit', 'laydate'],
            function () {
                var form = layui.form;
                var layer = layui.layer;
                var laydate = layui.laydate;

                //监听提交
                form.on('submit(submitButton)', function (data) {
                    $.post("updates", data.field, function (obj) {
                        if (obj.result == 1) {
                            layer.msg(obj.msg, {
                                icon: 1,
                                time: 2000
                            });
                            return false;
                        } else {
                            layer.msg(obj.msg, {
                                icon: 2,
                                time: 2000
                            });
                            return false;
                        }
                    });

                    return false;
                });

            });
</script>

</body>
</html>